from flask import Flask
import config
from exts import db
from flask_migrate import Migrate
# 引入模型
# 万年历结构
from models import Today_in_history
from models import software_All


from blueprints.Today_h import bp as Today_bp
from blueprints.software_All import bp as software_bp
from blueprints.software_info import  bp as software_info_bp
from blueprints.PM_almanac import  bp as PM_bp
from blueprints.TruthDare import bp as  TD_bp
app = Flask(__name__)


app.config.from_object(config)
db.init_app(app)

# 通过脚本更新数据库表结构
migrate = Migrate(app, db)

app.register_blueprint(Today_bp)
app.register_blueprint(software_bp)
app.register_blueprint(software_info_bp)
app.register_blueprint(PM_bp)
app.register_blueprint(TD_bp)


@app.route('/')
def hello_world():
    # 直接在这个位置查看数据是否正常
    return '接口启动成功'


if __name__ == '__main__':
    app.config['JSON_AS_ASCII'] = False
    app.run(port=8000, debug=True, host='127.0.0.1')
